/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.util.Comparator;

/**
 * @author Lionel
 */
public class StageMapped {

    private int activityID;
    private String description;
    private int duration;
    private String label;
    private int level;
    private int minAge;
    private double price;
    private String regitrationDateLine;
    private int registrationMax;
    private int sportrainingID;
    private String startDate;
    private int registrationCount;
    private int registrationAvailable;

    public StageMapped(int sporttrainingID, String description, int duration, String label, int level, int minAge, double price, String registationDateLine, int registrationMax, int registrationCount, String startDate) {
        this.sportrainingID = sporttrainingID;
        this.description = description;
        this.duration = duration;
        this.label = label;
        this.level = level;
        this.minAge = minAge;
        this.price = price;
        this.regitrationDateLine = registationDateLine;
        this.registrationMax = registrationMax;
        this.startDate = startDate;
        this.setRegistrationAvailable(registrationMax - registrationCount);

    }

    /**
     * @return the activityID
     */
    public int getActivityID() {
        return activityID;
    }

    /**
     * @param activityID the activityID to set
     */
    public void setActivityID(int activityID) {
        this.activityID = activityID;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return the duration
     */
    public int getDuration() {
        return duration;
    }

    /**
     * @param duration the duration to set
     */
    public void setDuration(int duration) {
        this.duration = duration;
    }

    /**
     * @return the label
     */
    public String getLabel() {
        return label;
    }

    /**
     * @param label the label to set
     */
    public void setLabel(String label) {
        this.label = label;
    }

    /**
     * @return the level
     */
    public int getLevel() {
        return level;
    }

    /**
     * @param level the level to set
     */
    public void setLevel(int level) {
        this.level = level;
    }

    /**
     * @return the minAge
     */
    public int getMinAge() {
        return minAge;
    }

    /**
     * @param minAge the minAge to set
     */
    public void setMinAge(int minAge) {
        this.minAge = minAge;
    }

    /**
     * @return the price
     */
    public double getPrice() {
        return price;
    }

    /**
     * @param price the price to set
     */
    public void setPrice(double price) {
        this.price = price;
    }

    /**
     * @return the regitrationDateLine
     */
    public String getRegitrationDateLine() {
        return regitrationDateLine;
    }

    /**
     * @param regitrationDateLine the regitrationDateLine to set
     */
    public void setRegitrationDateLine(String regitrationDateLine) {
        this.regitrationDateLine = regitrationDateLine;
    }

    /**
     * @return the registrationMax
     */
    public int getRegistrationMax() {
        return registrationMax;
    }

    /**
     * @param registrationMax the registrationMax to set
     */
    public void setRegistrationMax(int registrationMax) {
        this.registrationMax = registrationMax;
    }

    /**
     * @return the sportrainingID
     */
    public int getSportrainingID() {
        return sportrainingID;
    }

    /**
     * @param sportrainingID the sportrainingID to set
     */
    public void setSportrainingID(int sportrainingID) {
        this.sportrainingID = sportrainingID;
    }

    /**
     * @return the startDate
     */
    public String getStartDate() {
        return startDate;
    }

    /**
     * @param startDate the startDate to set
     */
    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public int getRegistrationAvailable() {
        return registrationAvailable;
    }

    public void setRegistrationAvailable(int registrationAvailable) {
        this.registrationAvailable = registrationAvailable;
    }

    public int getRegistrationCount() {
        return registrationCount;
    }

    public void setRegistrationCount(int registrationCount) {
        this.registrationCount = registrationCount;
    }

    public static class StageMappedComparators {

        public static Comparator<StageMapped> Age = new Comparator<StageMapped>() {

            @Override
            public int compare(StageMapped o1, StageMapped o2) {
                return Integer.compare(o1.getMinAge(), o2.getMinAge());
            }
        };

        public static Comparator<StageMapped> Price = new Comparator<StageMapped>() {

            @Override
            public int compare(StageMapped o1, StageMapped o2) {
                return Double.compare(o1.getPrice(), o2.getPrice());
            }
        };
        public static Comparator<StageMapped> StageID = new Comparator<StageMapped>() {
            @Override
            public int compare(StageMapped o1, StageMapped o2) {
                return Integer.compare(o1.getSportrainingID(), o2.getSportrainingID());
            }
        };
    }
}
